package net.lzzy.lxq.controller;

import net.lzzy.lxq.entities.Attendance;
import net.lzzy.lxq.server.AttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class AttendanceController {

    @Autowired
    AttendanceService service;


    @PostMapping("/get_attendance")
    public List<Attendance> getUserAttendance(@RequestBody List<Map<String,String>>param){
        return service.getUserAttendance(param.get(0).get("userId"));
    }

    @GetMapping("/get_attendance_all")
    public List<Attendance> getUserAttendance(){
        return service.getAll();
    }
}
